== How are scheme values represented in C? ==

There are simple "immediate" data types like booleans and numbers.  They are self contained and can be built like this:

#define SDBOOL(t) (sdata){.tag = tbool, .value = t}
#define SDNUMB(t) (sdata){.tag = tnumb, .ivalue = t}

Then there are symbols which are sort of like a mid-way between immediate and complex data that requires allocation.  We "intern" symbol names into a symbol table.  That enables us to reference a long complicated symbol name just using one integer.

You might intern("x"), intern("y") then {.tag = tsymb, .value = 0} would represent 'x and {.tag = tsymb, .value = 1} would represent 'y.

A similar but a more general structure is the heap which is just scratch space for any number of data. When we allocate a cons cell we ask for 2 spaces in the heap. For example we might end up with {.tag = tcons, .value = 325} which means that the car is at place 325 and the cdr is at place 326 of the heap.

Vectors work in a similar way but they reserve 1 + length slots in the heap, first to store their length then to store their elements.
